package com.pearl.jacksonspringboot.demo.custom;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import org.springframework.boot.jackson.JsonObjectSerializer;

import java.io.IOException;

/**
 * @author TD
 * @version 1.0
 * @date 2024/4/12
 */
public class CustomJsonObjectSerializer extends JsonObjectSerializer<String> {

    @Override
    protected void serializeObject(String value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
        System.out.println("CustomJsonObjectSerializer");
        jgen.writeString(value);
    }
}
